package com.zpark.service.impl;

import com.zpark.dao.IUserDao;
import com.zpark.entity.User;
import com.zpark.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @PackageName: com.zpark.service.impl
 * @ClassName: UserServiceImpl
 * @Description:
 * @author: RZS
 * @date: 2023/5/11  14:55
 */
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserDao userDao;

    @Override
    public Integer addUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public Integer delUserById(Integer id) {
        return userDao.deleteUserById(id);
    }

    @Override
    public Integer changeUserUnameById(String uname, Integer id) {
        return userDao.updateUserUnameById(uname, id);
    }

    @Override
    public List<User> findAll() {
        return userDao.selectAll();
    }

    @Override
    public User findById(Integer id) {
        return userDao.selectById(id);
    }
}
